<?php
session_start();

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Schools Management System</title>
<meta http-equiv="Content-Language" content="English" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="../style.css" media="screen" />

</head>
<body>
<?php
include_once '../Login/databaseconnection.php';

if(!loggedin())
{
require_once '../index.php';
}
   
   else
   {
   if(isset($_POST['Edit_This'])||isset($_POST['SaveChanges']))
	   {
 if( $T_NIC_Number==" ")
	   {
		    
	$_SESSION['errorin1']="Not enough inputs!";
}
}
   ?>
   <div id="wrap">

<div id="header">
<table width="1188" border="0">
  <tr>
    <td width="706" height="119"><h1 class="heaaderte"><font color="#996699" style="text-shadow:#969" size="+6">Schools Management System</font></h1></td>
    <td width="472">&nbsp;</td>
  </tr>
</table>
<h1>&nbsp;</h1>
</div>

<div id="menu1_bg">
		<div id="menu1">
			
	
	
				<ul>
				<li><a href="../index.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Home</font></a></li>
				<li><a href="../Schools/Schools.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Schools</font></a></li>
				<li><a href="teachers.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Teachers</font></a></li>
				<li><a href="../Lab/Labs.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Labs</font></a></li>
				<li><a href="../Resources/Resources.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Resources</font></a></li>
                <li><a href="#"><font color="#CCCC66" style="text-shadow:#969" size="+1">Resource Team</font></a></li>
                         <li><a href="../Programmes/Programmes.php" class="active"><font color="#CCCC66" style="text-shadow:#969" size="+1">Programmes</font></a></li>
                                  <li><a href="../Competition/Competition.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Competitions</font></a></li>
                 <li></li>
			</ul>
	</div>
  </div>
<div class="left">
  
<div class="articles"><form action="#" method="POST">
  <table width="354" border="0">
    <tr>
      <th colspan="2"  scope="row"><?php
		if(isset($_POST['Edit_This'])||isset($_POST['SaveChanges']))
{
	if($_SESSION['error']!=" ")
	{
		echo ($_SESSION['error']);
		$_SESSION['error']="";
	}
	if($_SESSION['errorin']!=" ")
	{
		echo ($_SESSION['errorin']);
		$_SESSION['errorin']="";
	}
	if($_SESSION['errorin1']!=" ")
	{
		echo ($_SESSION['errorin1']);
		$_SESSION['errorin1']="";
	}
}
		?></th>
      </tr>
    <tr>
      <th width="200"  scope="row">
        Teachers NIC Number:</th>
      <td width="144"><select name="$T_NIC_Number">
        <option>897631628V</option>
      </select></td>
    </tr>
  </table>
  <br/>
      <a href="updatetea.php">Reset</a>|
    <input name="Edit_This" align="middle" type="submit" value="Edit this" />
      <br/>
  
</form>
    <?php 

if(isset($_POST['SaveChanges']))
{
	include_once 'UPP.php';
}
	   if(isset($_POST['Edit_This']))
	   {
	    $T_NIC_Number=$_POST['T_NIC_Number'];
	   
	   }
	   
	   if($T_NIC_Number!=" ")
	   {
   $result=mysql_query("SELECT * FROM teacher WHERE T_NIC_Number='$T_NIC_Number'");
	   
    echo '<table width="458" border="0">';
	while($row=mysql_fetch_array($result))
  { 
  $T_NIC_Number=$row['T_NIC_Number'];
  $School_Id=$row['School_Id'];
  $First_Name=$row['First_Name'];
  $Last_Name=$row['Last_Name'];
  $Date_Of_Birth=$row['Date_Of_Birth'];
  $Gender=$row['Gender'];
  $Nature_Of_Appointment=$row['Nature_Of_Appointment'];
  $Service=$row['Service'];
  $Acadamic_Qualifications=$row['Acadamic_Qualifications'];
  $Professional_Qualifications=$row['Professional_Qualifications'];
  $Achievements=$row['Achievements&Awards'];
  $Address=$row['Address'];
  $Mobile_Tp_Number=$row['Mobile_Tp_Number'];
  $Home_Tp_Number=$row['Home_Tp_Number'];
  $Office_Tp_Number=$row['Office_Tp_Number'];
  $Appointment_Date=$row['Appointment_Date'];
  $Appointed_Subject=$row['Appointed_Subject']; 
    ?>
 
 <?php
 echo '<table width="957" border="1">';
 echo '	<tr>';
echo '<td width="94">';
echo "NicNumber";
echo '</td>';
echo '<td width="94">';
echo "School Id";
echo '</td>';
echo '<td width="94">';
echo "First Name";
echo '</td>';
echo '<td width="130">';
echo "Last Name";
echo '</td>';
echo '<td width="158">';
echo 'Date of Birth';
echo '</td>';
echo '<td width="158">';
echo 'Gender';
echo '</td>';
echo '<td width="137">';
echo 'Nature of Appointment';
echo '</td>';
echo '<td width="93">';
echo 'Service';
echo '</td>';
echo '<td width="159">';
echo 'Acadamic Qualifications';
echo '</td>';
echo '<td width="159">';
echo 'Professional_Qualifications';
echo '</td>';
echo '<td width="159">';
echo 'Achievements';
echo '</td>';
echo '<td width="159">';
echo 'Address';
echo '</td>';
echo '<td width="159">';
echo 'Mobile Telephone Number';
echo '</td>';
echo '<td width="159">';
echo 'Home Telephone Number';
echo '</td>';
echo '<td width="159">';
echo 'Office Telephone Number';
echo '</td>';
echo '<td width="159">';
echo 'Appointment Date';
echo '</td>';
echo '<td width="159">';
echo 'Appointed Subject';
echo '</td>';
 echo '</tr>';
	 }
   echo '</table>';
   
   echo "<br/>";
   echo '<input name="SaveChanges" align="middle" type="submit" value="Save changes" />';
 }
	   
	   ?>
   
</div>
</div>


<div class="rightmenu"> 
<h1>TEACHERS</h1><br />
<table width="220" border="0">
  <tr>
    <td width="210" height="41"><a href="regtea.php">Add New Teaher Details</a></td>
   

  </tr>
 
  <tr>
    <td height="41"><a href="searchtea.php">Search Teachers Details</a></td>

    
  </tr>
  <tr>
    <td height="41"><a href="updatetea.php">Update a Teachers Details</a></td>
 
    
  </tr>
  <tr>
    <td height="41"><a href="deltea.php">Delete Teachers Details</a></td>
    
    
  </tr>
  <tr>
    <td height="41"><a href="viewalltea.php">View All</a></td>
   

  </tr>
</table>
</div>
 
 <div style="clear: both;"> </div>


<div id="footer"><table width="1236" height="38" border="0">
    <tr>
      <td width="904" height="34">Schools Managemrnt System &copy; 2012 </td>
      <td width="50"><strong><a href="#" class="active">Home</a><a href="#"></a></strong>|</td>
      <td width="80"><strong><a href="#">Contact us</a></strong>|</td>
      <td width="40"><a href="http//www.facebook.com"><img src="../images/facebook1.png" width="54" height="54"/></a></td>
      <td width="38"><a href="http//twitter.com"><img src="../images/twitter.png" width="35" height="47"/></a></td>
      <td width="36"><a href="http//www.google.lk"><img src="../images/google.png" width="64" height="64"/></a><a href=""http="http"//www.yahoo.com""></a></td>
      <td width="58"><a href=""http="http"//www.yahoo.com""><img src="../images/yahoo.png" alt="" width="64" height="64"/></a></td>
    </tr>
  </table>
</div>
</div>
<?php

}
?>
</body>
</html>